From: Ewan Mellor Date: Tue, 20 Mar 2007 17:36:18 +0000 (+0000) Subject: Raise an exception in xm_block_detach if using Xen-API and it fails -- this X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15282^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=5b3327347f83a473755b00a76ff1176dc6cda301;p=xen.git Raise an exception in xm_block_detach if using Xen-API and it fails -- this ensures that the exit status properly set. Signed-off-by: Tom Wilkie --- diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index a138afdd95..66a5951f7f 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -1962,7 +1962,8 @@ def xm_block_detach(args): if len(server.xenapi.VDI.get_VBDs(vdi_ref)) <= 0: server.xenapi.VDI.destroy(vdi_ref) else: - print "Cannot find device '%s' in domain '%s'" % (dev,dom) + raise OptionError("Cannot find device '%s' in domain '%s'" + % (dev,dom)) else: try: detach(args, 'block-detach', 'vbd')